<?php
/**
 * Created by PhpStorm.
 * User: liu
 * Date: 2018/9/11
 * Time: 22:50
 */

namespace app\blog\controller;



use think\Controller;

class Post extends Controller
{
    public function index(){
        $id=input('id',0,'intval');
        $row=\app\admin\model\blog\Post::where(['id'=>$id,'status'=>0])
            ->with('comments,category')
            ->find();
        $comments=$row->comments()->paginate();
        return $this->fetch('',['row'=>$row,'comments'=>$comments]);
    }
}